<! DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>while do...while验证用户名和密码</title>
</head>
<body>
<script>
    do{
   
        alert("用户名或密码有误");
        userName=prompt("请输入用户名");
        passWord=prompt("请输入密码");
    }while(userName!="admin"||passWord!="123456")
    alert("登录成功");

</script>
</body>
</html>